<? include_once("../../../common/common_setting_unit.php"); //引入通用的设置文件?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <? include_once(ROOT_PATH_ . "/controller/common/module/head.php"); ?>
    <? include_once("../controller/data_add.php"); ?>
    <!-- 引入侧边弹出插件 -->
    <link href="/application/right_plane/style.css" rel="stylesheet" type="text/css" />
    <script src="/application/right_plane/js.js"></script>
</head>


<body>
<div id="topbar">
    <?php include ROOT_PATH_ . '/controller/common/module/topbar.php'; ?>
</div>



<div id="container" class="<? echo $now_extender ?>">
    <div id="maincontent">


        <div id="sidebar">
            <?php include ROOT_PATH_ . '/controller/common/module/sidebar.php'; ?>
        </div>



        <div id="content">

            <!--标题设定-->
            <?php $page_title='编辑';?>
            <?php include ROOT_PATH_ . '/controller/common/module/mod-page-title.php'; ?>
            <?php include('module/mod-right-plane.php'); ?>






            <div class="detail-box">


                <ul class="detail-boxing">
                    <form id="data_form" method="post" class="layui-form"
                          action ="data_add_function.php?<? echo $data['url_parameter'] ?>"
                          enctype="multipart/form-data">

                        <input type="hidden"  name="nid" value="<? echo $data['data_detail']['nid']?>" >

                        <fieldset class="layui-elem-field layui-field-title" >
                            <legend>基本信息</legend>
                        </fieldset>



                        <!--需要用弹出窗口去做，这里因为企业太多了-->
                        <li class="layui-form-item name">
                            <label class="layui-form-label">所属企业：</label>
                            <div class="layui-input-block">
                                <!-- 企业ID -->
                                <input type="hidden" name="ai_unit_nid">
                                <!-- 企业名称 -->
                                <input type="text" name="ai_unitname" placeholder="请输入企业名称并点击查找" autocomplete="off" class="layui-input">
                                <div class="layui-col-md12">
                                    <div class="notice">如果查询结果无匹配的企业供选择，则按当前输入的内容新增企业</div>
                                </div>
                            </div>
                        </li>



                        <li class="layui-form-item">
                            <label class="layui-form-label">项目类型：</label>
                            <div class="layui-input-block">

                                <? foreach ($tag_array as $k => $v) { ?>
                                    <input type="radio" name="ai_case_type" value="<? echo $v ?>" title="<? echo $v ?>"
                                        <?if($v=="其他"){echo "checked";}?> />
                                    <?;
                                } ?>

                                <div class="notice">项目类型可以在<a href="plate-edit.php?sys_part=case">【板块设置】</a>中设置</div>
                            </div>
                        </li>




                        <li class="layui-form-item">
                            <label class="layui-form-label">负责人</label>
                            <div class="layui-input-block">
                                <select name="ai_principal">
                                    <option value="<? echo $data['data_detail']['principal']?>"><? echo $data['data_detail']['principal']." : ".$employee_name_array[$data['data_detail']['principal']]?></option>
                                    <option value="">无</option>
                                    <? for($i=0;$i<count($employee_list);$i++){ ?>
                                        <option value="<? echo $employee_list[$i]['nid'] ?>"><? echo $employee_list[$i]['nid'] ?> : <? echo $employee_list[$i]['name'] ?></option>
                                    <? } ?>
                                </select>
                            </div>
                        </li>



                        <!--普通的input文本输入-->
                        <li class="layui-form-item name">
                            <label class="layui-form-label">预计金额：</label>
                            <div class="layui-input-block">
                                <input type="text" class="layui-input"  name="ai_price"  value="0">
                            </div>
                        </li>


                        <li class="layui-form-item name">
                            <label class="layui-form-label">预计成交：</label>
                            <div class="layui-input-block">
                                <input type="text" name="ai_except_time" id="date" autocomplete="off" class="layui-input"
                                       value="<? echo  date("Y-m-d H:i:s",  strtotime("+30 days", strtotime( date("Y-m-d H:i:s"))))?>"
                                       onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" class="laydate-icon">
                            </div>
                        </li>

                        <li class="layui-form-item name">
                            <label class="layui-form-label">开始时间：</label>
                            <div class="layui-input-block">
                                <input type="text" name="ai_start_time" id="date" autocomplete="off" class="layui-input"
                                       value="<? echo date("Y-m-d H:i:s")?>"
                                       onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" class="laydate-icon">
                            </div>
                        </li>


                        <li class="layui-form-item name">
                            <label class="layui-form-label">完结时间：</label>
                            <div class="layui-input-block">
                                <input type="text" name="ai_end_time" id="date" autocomplete="off" class="layui-input"
                                       value="<? echo  date("Y-m-d H:i:s",  strtotime("+60 days", strtotime( date("Y-m-d H:i:s"))))?>"
                                       onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" class="laydate-icon">
                            </div>
                        </li>




                        <!--普通的textarea多行文本输入-->
                        <li class="layui-form-item introduce">
                            <label class="layui-form-label">备注：</label>
                            <div class="layui-input-block">
                                <textarea class="layui-textarea" name="ai_remark"  ><?echo  $data['data_detail']['remark']?></textarea>
                            </div>
                        </li>




                        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;" id="content3">
                            <legend>更多资料</legend>
                        </fieldset>

                        <br/>





                        <!--单选项-->
                        <li class="layui-form-item status">
                            <label class="layui-form-label">状态：</label>
                            <div class="layui-input-block">
                                <input name='ai_status' type='radio' value='未开始' title="未开始" checked='checked'/>
                                <input name='ai_status' type='radio' value='跟进中' title="跟进中" />
                                <input name='ai_status' type='radio' value='终止' title="终止" />
                            </div>
                        </li>







                        <div class="function">

                            <button class="layui-btn"  lay-submit type="submit" >立即提交</button>
                            <input type="reset" class="layui-btn" value="重置"/>

                            <a 	class="layui-btn layui-btn-normal" href="#content1" style="margin-left: 35px">基本信息</a>
                            <a href="javascript:;" class="layui-btn layui-bg-red layui-icon layui-icon-top go_top"></a>
                        </div>



                    </form>
                </ul>
            </div>
        </div>



        <?
        //==============================================================================
        //这里上面才是平常开发需要注重的部分，下面的基本不用理会，只有底部JS部分需要根据实际情况去加载
        //==============================================================================
        ?>



    </div>
    <!--detail-box end-->


</div>
<!--content端點01-->



</div>
<!--maincontent-->
<br class="clearfloat"/>
</div>
<!--container-->
</div>





<!--渲染日期需要用到的-->
<script>
    layui.use('laydate', function(){
        var laydate = layui.laydate;

        //执行一个laydate实例
        laydate.render({
            elem: '#publish_date' //指定元素
            ,type: 'datetime'
        });
    });
</script>




<?php include ROOT_PATH_ . "/controller/common/module/footer.php"; ?>
<script src="../asset/js/obtion-unit.js"></script>
</body>
</html>